--[[/**
-- * 
 * 增加时移除指定[0]BUFF,并把[0]BUFF身上的[1]属性值 取出来，放到自己身上
 * 结束时加上指定[2]Buff
 *
-- *
-- */]]

---@class BuffEffect185101 : BaseBuffEffect
BuffEffect185101 = ClientFight.CreateClass("BuffEffect185101", ClientFight.BaseBuffEffect)
local t = BuffEffect185101

---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local source = buff.source;
    local buff1 = BuffManager.getBuffByModel(source, buff.buffBean.f_BuffEffectValue[1]);
    if (buff1 == nil)
    then
    return IBuffEffect.FAIL;
    end
    --把这个buff1身上的数值取出来
    local curAttrVal = 0;
    if (not table.getn(buff1.attributes.attributes) == 0)
    then
    curAttrVal = buff1.attributes.attributes.get(buff.buffBean.f_BuffEffectValue[2]);
    end

    buff.attributes.attributes.put(buff.buffBean.f_BuffEffectValue[2], curAttrVal);
    buffManager.removeFighterBuff(fight, source, buff1, true);
    SkillRoleMgr.savePathFile(
    "[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff"
    .. buff.modelId .. " 移除掉Buff[0]" .. buff.buffBean.f_BuffEffectValue[1]
    );

    return ClientFight.BaseBuffEffect.add(self,fight, buff);
end

t.New()